<?php $this->pageHeader('Arrangementer'); ?>

<?php echo $this->flashMessage()->renderMessages(); ?>

<div class="header_wrapper">
    <h1>Arrangementer</h1>
    <?php echo $this->filterForm; ?>
</div>

<table class="core_events">
  <thead>
        <tr>
            <th>Type</th>
            <th>Navn</th>
            <th>Sted</th>
            <th>Starttidspunkt</th>
            <th>Sluttidspunkt</th>
        </tr>
  </thead>
    <tbody>
<?php foreach($this->events as $event) : ?>
        <tr>
            <td class="core_event_<?php echo strtolower($event['type']) ?>">
                <?php echo $this->escape($event['type']); ?>
            </td>
            <td>
                <a href="<?php echo $this->url(array('module' => 'core', 'controller' => 'event', 'action' => 'view', 'id' => $event['id']), null, true); ?>">
                    <?php echo $this->escape($event['name']); ?>
                </a>
            </td>
            <td><?php echo $this->escape($event['location']); ?></td>
            <td>
            <?php
                $date = new RedCross_Date();
                $date->import($event['from_date']);
                echo $date->getDateTimeStr();
            ?>
            </td>
            <td>
            <?php
                $date->import($event['to_date']);
                echo $date->getDateTimeStr();
            ?>
            </td>
        </tr>
<?php endforeach; ?>
    </tbody>
</table>
